package com.flower.controller;

import com.flower.model.entity.Unit;
import com.flower.result.Result;
import com.flower.service.UnitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@SuppressWarnings("all")
/**
 *@ClassName UnitController
 *@Description TODO
 *@Author @O_o  GW__
 *@Date 2025/6/17 00:00
 *@Version 1.0
 */
@Api("查询数量单位")
@RestController
@RequestMapping("/unit")
@Slf4j
public class UnitController {
    @Autowired
    private UnitService unitService;

    @GetMapping
    @ApiOperation("查询数量单位")
    public Result<List<Unit>> getUnit() {
        List<Unit> unit = unitService.getUnits();
        return Result.success(unit);
    }
}
